<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> New Document </title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <style type="text/css">

  </style>
  <link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css"></link>
  <link rel="stylesheet" type="text/css" href="ext/resources/css/xtheme-slate.css"></link>
  <link rel="stylesheet" type="text/css" href="css/public.css"></link>
		<script src="ext/adapter/ext/ext-base.js"></script>
		<script src="ext/ext-all.js"></script>
		<script src="ext/src/locale/ext-lang-zh_CN.js"></script>		
  		<script src="ext/base/TabCloseMenu.js"></script>
  <script>
  /* Create a new XMLHttpRequest object to talk to the Web server */
  var xmlHttp = false;
  /*@cc_on @*/
  /*@if (@_jscript_version >= 5) 
	  try { 
		  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		  } catch (e) { 
			  try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); 
			  } catch (e2) {
				  xmlHttp = false; 
				  }
			  }
		  @end @*/ 
		  if (!xmlHttp && typeof XMLHttpRequest != 'undefined') { 
			  xmlHttp = new XMLHttpRequest();
			}
	Ext.BLANK_IMAGE_URL = 'ext/resources/images/default/s.gif';
	Ext.onReady(function(){
		
		Ext.Ajax.on('requestcomplete',checkUserSessionStatus, this);      
		function checkUserSessionStatus(conn,response,options){      
		    if(response.getResponseHeader('sessionstatus')){      
		    	parent.location.href='/xdj/index.jsp';   
		    }      
		}  
		Ext.QuickTips.init();//提示错误信息的，要想提示中文的必须开启
		
		var top = new Ext.Toolbar({
					height:60,
					//html:'<cneter><img src="image/base/logo.jpg" height=30><center>',
					items:[{
						//html:'<img src="image/base/logo1.png" width=80 height=30>',
						//xtype:'tbtext'
						cls:'logo',
						width:1800,
						height:60,
						xtype:'tbtext'
					}
					]
				});
		var date=new Date();
		var d=date.format('Y-m-d H:i:s');
		var topTwo=new Ext.Toolbar({
			height:30,
			columnWidth:.40,
			items:['->',{
						text:'登录 :  <%=session.getAttribute("username")%>',
						//iconCls: "login"
						cls:'login',
						icon:'image/index/login.png'
					},{
						text:'所属部门:  <%=session.getAttribute("department")%>',
						cls:'depart',
						icon:'image/index/dep.png'
					},{
						text:'角色：<%=session.getAttribute("userrole")%>',
						cls:'role',
						icon:'image/index/role.png'
					},{
						text:'登录时间:  '+d,
						cls:'time',
						
						icon:'image/index/time.png'
						
					}]
		});
		var tab = new Ext.TabPanel({  //TabPanel 开始 就是每个选项框附在框架右边的
					region:'center',
					border:'false',
					tabWidth:100,
					deferredRender:false,
					activeTab:0,
					resizeTabs:true,
					baseCls:'logo4',
					enableTabScroll:true,
					//defaults: {autoScroll:true},
					autoScroll:true,
					closable:true,
					plugins: new Ext.ux.TabCloseMenu()
				});
		
			var bottom = new Ext.Toolbar({
				height:25,
				items:[{
					
				}]
			});
		
		new Ext.Viewport({
			layout:'border',
			border:false,
			renderTo:'index',
			items:[{
				region:'north',
				//id:'logo',
				height:80,
				items:[top,topTwo]
			},{
				region:'south',
				height:25,
				items:[bottom]
			},{
				region:'west',
				border:'false',
				id : 'west-panel',
				width:200,
				split:true,
				baseCls:"left",// 左边的背景图

				//minSize:40,
				//maxSize:80,
				//title:'菜单',
				//collapsible:true,
				layout:'accordion',
				split : false,//拉伸
				layoutConfig:{
					animate:true,
					activeOnTop:false, //展开谁，谁就在前面
					activeOnTop:false
				},
				items:[
					{
						id:'ControlBaseInfo',
						hidden:true,
						title:'基础信息',
						border:false,
						//cls:'test',
						height:400,
						width:200,
						collapsible:true,	
						titleCollapse:true, //点击标题也可以展开关闭菜单栏
						collapsed : true ,//默认菜单不展开
						html:'<div id="tree01" style="overflow:auto;background-image: url(image/base/test.png ) !important;width:100%;height:100%" ></div>'
					},
					{
						id:'ControlPlanManagements',
						hidden:true,
						title:'巡点管理',
						border:false,
						collapsible:true,	
						titleCollapse:true, //点击标题也可以展开关闭菜单栏
						collapsed : true, //默认菜单不展开
						html:'<div id="tree02" style="overflow:auto;background-image: url(image/base/test.png ) !important;width:100%;height:100%" ></div>'
					},
					{
						id:'PerformanceManagement',
						hidden:true,
						title:'实绩管理',
						border:false,
						collapsible:true,
						titleCollapse:true,
						collapsed : true,
						html:'<div id="tree03" style="overflow:auto;background-image: url(image/base/test.png ) !important;width:100%;height:100%" ></div>'
					},
					{
						id:'ControlCheckManagement',
						hidden:true,
						title:'考核管理',
						border:false,
						collapsible:true,
						titleCollapse:true,
						collapsed : true,
						html:'<div id="tree04" style="overflow:auto;background-image: url(image/base/test.png ) !important;width:100%;height:100%" ></div>'
					},
					{
						id:'ControlCheckStandardManagement',
						hidden:true,
						title:'标准管理',
						border:false,
						collapsible:true,
						titleCollapse:true,
						collapsed : true,
						html:'<div id="tree05" style="overflow:auto;background-image: url(image/base/test.png ) !important;width:100%;height:100%" ></div>'
					},
					{
						id:'报告管理',
						hidden:true,
						title:'报告管理',
						border:false,
						collapsible:true,
						titleCollapse:true,
						collapsed : true,
						html:'<div id="tree06" style="overflow:auto;background-image: url(image/base/test.png ) !important;width:100%;height:100%" ></div>'
					},
					{
						id:'ControlSystemManagement',
						hidden:true,
						title:'系统管理',
						border:false,
						collapsible:true,
						titleCollapse:true,
						collapsed : true,
						html:'<div id="tree07" style="overflow:auto;background-image: url(image/base/test.png ) !important;width:100%;height:100%" ></div>'
					}
				]
			},tab
			],
			listeners:{
				'beforerender' : function(cmp) {
					// set role
					var store=new Ext.data.JsonStore({
						url: 'system/role_loadFunc',
						autoLoad : true,
						fields: ["functioncode"]
					});
					store.load({
					    callback: function(records, options, success){
					    	var i=0;
					    	for(; i<records.length; i++) {
					    		var id = records[i].get("functioncode");
					    		if(Ext.getCmp(id)!=null) {
						    		Ext.getCmp(id).setVisible(true);
					    		}else if(tree01.getNodeById(id)!=null) {
					    			tree01.getNodeById(id).getUI().show();
					    		}else if(tree02.getNodeById(id)!=null) {
					    			tree02.getNodeById(id).getUI().show();
					    		}else if(tree03.getNodeById(id)!=null) {
					    			tree03.getNodeById(id).getUI().show();
					    		}else if(tree04.getNodeById(id)!=null) {
					    			tree04.getNodeById(id).getUI().show();
					    		}else if(tree05.getNodeById(id)!=null) {
					    			tree05.getNodeById(id).getUI().show();
					    		}else if(tree06.getNodeById(id)!=null) {
					    			tree06.getNodeById(id).getUI().show();
					    		}else if(tree07.getNodeById(id)!=null) {
					    			tree07.getNodeById(id).getUI().show();
					    		}
					        }
					    },
					    scope: store
					});
				}
			}
		});
		
		var tree01 = new Ext.tree.TreePanel({
					renderTo:'tree01',
					animate:true,
					baseCls:'test',
					border:false,
					rootVisible:false, //标题
					lines:false, //线段
					root:new Ext.tree.AsyncTreeNode({
						expanded:true,
						children:[{
							id:"ControlDepartment",
							hidden:true,
							text:'部门管理',
							leaf:true,
							href:'base/department.jsp'
						},{
							id:"ControlStation",
							hidden:true,
							text:'岗位管理',
							leaf:true,
							href:'base/station.jsp'
						},{
							id:"ControlProfess",
							hidden:true,
							text:'专业信息',
							leaf:true,
							href:'base/profess.jsp'
						},{
							id:"ControlUser",
							hidden:true,
							text:'员工管理',
							leaf:true,
							href:'base/user.jsp'
						},{
							id:"ControlDeviceTree",
							hidden:true,
							text:'设备管理',
							leaf:true,
							href:'base/device.jsp'
						},{
							id:"ControlDefineIDZone",
							hidden:true,
							text:'ID位置',
							leaf:true,
							href:'base/ID.jsp'
						},{
							id:"ControlZoneDevice",
							hidden:true,
							text:'区域设备',
							leaf:true,
							href:'base/zone.jsp'
						},{
							id:"ControlClassDuty",
							hidden:true,
							text:'班次设置',
							leaf:true,
							href:'base/class.jsp'
						},{
							id:"ControlDuty",
							hidden:true,
							text:'值次设置',
							leaf:true,
							href:'base/duty.jsp'
						},{
							id:"ControlDutyRule",
							hidden:true,
							text:'翻版规则',
							leaf:true,
							href:'base/turn_duty.jsp'
						}
						]
					}),
					listeners:{
						click:function addTab(node,event){
							addTab(node,event);
						}
					}
				});
		var tree02= new Ext.tree.TreePanel({
			renderTo:'tree02',
			animate:true,
			border:false,
			baseCls:'test',
			rootVisible:false, //标题
			lines:false, //线段
			root:new Ext.tree.AsyncTreeNode({
				expanded:true,
				children:[{
					id:"ControlDutyUser",
					hidden:true,
					text:'人员配置',
					leaf:true,
					href:'check/userPlan.jsp'
				},{
					id:"ControlTurn",
					hidden:true,
					text:'轮次设置',
					leaf:true,
					href:'check/turn.jsp'
				},{
					id:"ControlCHKLine",
					hidden:true,
					text:'路线管理',
					leaf:true,
					href:'check/line.jsp'
				},{
					id:"ControlCHKLineConf",
					hidden:true,
					text:'路线配置',
					leaf:true,
					href:'check/lineConf.jsp'
				},{
					id:"ControlCHKPlan",
					hidden:true,
					text:'计划制定',
					leaf:true,
					href:'check/makePlan.jsp'
				},{
					id:"ControlPlanManagement",
					hidden:true,
					text:'计划管理',
					leaf:true,
					href:'check/planMan.jsp'
				},{
					id:"ControlPlanFind",
					hidden:true,
					text:'计划查询',
					leaf:true,
					href:'check/plan.jsp'
				}
				]
			}),
			listeners:{
				click:function addTab(node,event){
					addTab(node,event);
				}
			}
		});
		
		var tree03= new Ext.tree.TreePanel({
			renderTo:'tree03',
			animate:true,
			border:false,
			baseCls:'test',
			rootVisible:false, //标题
			lines:false, //线段
			root:new Ext.tree.AsyncTreeNode({
				expanded:true,
				children:[{
					id:"ControlPerformanceFind",
					hidden:true,
					text:'实绩查询',
					leaf:true,
					href:'result/exam.jsp'
				},{
					id:"ControlTrendChartTree",
					hidden:true,
					text:'结果趋势',
					leaf:true,
					href:'result/result.jsp'
				},{
					id:"ControlMultiDevice",
					hidden:true,
					text:'多点比较',
					leaf:true,
					href:'result/comparable.jsp'
				},{
					id:"ControlExceptionFind",
					hidden:true,
					text:'异常查询',
					leaf:true,
					href:'result/exception.jsp'
				},{
					id:"ControlExceptionStatistic",
					hidden:true,
					text:'异常统计',
					leaf:true,
					href:'result/sexception.jsp'
				}
				]
			}),
			listeners:{
				click:function addTab(node,event){
					addTab(node,event);
				}
			}
		});
		
		var tree04= new Ext.tree.TreePanel({
			renderTo:'tree04',
			animate:true,
			baseCls:'test',
			border:false,
			rootVisible:false, //标题
			lines:false, //线段
			root:new Ext.tree.AsyncTreeNode({
				expanded:true,
				children:[{
					id:"ControlAssignmentCheckStatistic",
					hidden:true,
					text:'考核统计',
					leaf:true,
					href:'audit/audit.jsp'
				},{
					id:"ControlLeakCheck",
					hidden:true,
					text:'漏检统计',
					leaf:true,
					href:'audit/loujian.jsp'
				},{
					id:"ControlOnDuty",
					hidden:true,
					text:'到位统计',
					leaf:true,
					href:'audit/daowei.jsp'
				},{
					id:"ControlWorkload",
					hidden:true,
					text:'工作量考核',
					leaf:true,
					href:'audit/gongshi.jsp'
				},{
					id:"ControlCheckLineStatistic",
					hidden:true,
					text:'路线考核',
					leaf:true,
					href:'audit/luxian.jsp'
				}
				]
			}),
			listeners:{
				click:function addTab(node,event){
					addTab(node,event);
				}
			}
		});
		var tree05= new Ext.tree.TreePanel({
			renderTo:'tree05',
			baseCls:'test',
			animate:true,
			border:false,
			rootVisible:false, //标题
			lines:false, //线段
			root:new Ext.tree.AsyncTreeNode({
				expanded:true,
				children:[{
					id:"ControlDeviceCheckStandardTree",
					hidden:true,
					text:'巡检标准',
					leaf:true,
					href:'standard/standard.jsp'
				},{
					id:"ControlDevAnswerList",
					hidden:true,
					text:'问题回答维护',
					leaf:true,
					href:'standard/answer.jsp'
				},{
					id:"ControlParameter",
					hidden:true,
					text:'参数设置',
					leaf:true,
					href:'standard/parameter.jsp'
				}]
			}),
			listeners:{
				click:function addTab(node,event){
					addTab(node,event);
				}
			}
		});
		
		var tree06= new Ext.tree.TreePanel({
			renderTo:'tree06',
			animate:true,
			border:false,
			baseCls:'test',
			rootVisible:false, //标题
			lines:false, //线段
			root:new Ext.tree.AsyncTreeNode({
				expanded:true,
				children:[{
					id:"ControlCheckLogReportFind",
					hidden:true,
					text:'巡检日志',
					leaf:true,
					href:'report/log.jsp'
				},{
					id:"ControlCheckWeekReportFind",
					hidden:true,
					text:'巡检周报',
					leaf:true,
					href:'report/week.jsp'
				},{
					id:"ControlCheckMonthReportFind",
					hidden:true,
					text:'巡检月报',
					leaf:true,
					href:'report/month.jsp'
				}]
			}),
			listeners:{
				click:function addTab(node,event){
					addTab(node,event);
				}
			}
		});
		
		var tree07= new Ext.tree.TreePanel({
			renderTo:'tree07',
			animate:true,
			border:false,
			baseCls:'test',
			rootVisible:false, //标题
			lines:false, //线段
			root:new Ext.tree.AsyncTreeNode({
				expanded:true,
				children:[{
					id:"FormModifyPassword",
					hidden:true,
					text:'修改密码',
					leaf:true,
					href:'system/password.jsp'
				},{
					id:"ControlRole",
					hidden:true,
					text:'角色管理',
					leaf:true,
					href:'system/role.jsp'
				},{
					id:"ControlRoleFunc",
					hidden:true,
					text:'角色权限',
					leaf:true,
					href:'system/function.jsp'
				},{
					id:"ControlRoleUser",
					hidden:true,
					text:'用户角色',
					leaf:true,
					href:'system/userRole.jsp'
				}
				]
			}),
			listeners:{
				click:function addTab(node,event){
					addTab(node,event);
				}
			}
		});
		
				function addTab(node,event){
					event.stopEvent();
					var n=tab.getComponent(node.id);
					if(!n){//判断是否已经打开该面板 
						n = tab.add( {
							'id' : node.id,
							'title' : node.text,
							closable : true, //通过html载入目标页  
							html : '<iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="'+node.attributes.href+'" ></iframe>'
						});
					}
					tab.setActiveTab(n);
				}
				Ext.get('loading').remove();
	});
	</script>
 </head>

 <body>
 <div id="index"><div id="loading"></div></div>
  <div id="logo" style="background: url("image/base/logo.jpg"); background-color: transparent;"></div>
 </body>
</html>
